
let str = 'background-color';//backgroundColor

const result = str.replace(/-([a-z])/,function(matched,group1){
   return group1.toUpperCase();
});
console.log(result);